package sample.positive.bean;

import sample.positive.service.SuperAbility;

/**
 * 狗狗基类
 */
public class Dog {

    /**
     * 超能力
     */
    private SuperAbility superAbility;

    /**
     * 添加超能力
     * @param superAbility
     */
    public void addSuperAbility(SuperAbility superAbility) {
        this.superAbility = superAbility;
    }

    /**
     * 犬吠
     */
    public void bark(){
        if(superAbility == null){
            System.out.println("Woof woof! I don't have superAbility.");
        }
        else {
            System.out.println("Woof woof! I can " + superAbility.name() + "!");
        }
    }
}
